import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    align: "center",
    dataIndex: 'realname',
    width: 130
  },
  // {
  //   title: '头像',
  //   align: "center",
  //   dataIndex: 'avatar'
  // },
  // {
  //   title: '出生日期',
  //   align: "center",
  //   dataIndex: 'birthday',
  //   width: 110,
  //   customRender:({text}) =>{
  //     return !text?"":(text.length>10?text.substr(0,10):text);
  //   },
  // },
 
  {
    title: '性别',
    align: "center",
    dataIndex: 'sex',
    width: 114,
    sorter: true,
    customRender: ({ text }) => {
      return render.renderDict(text, 'sex');
    },
  },
  {
    title: '员工编号',
    width: 150,
    dataIndex: 'workNo',
  },
  // {
  //   title: '所在部门',
  //   width: 172,
  //   dataIndex: 'orgCode',
  // },
  // {
  //   title: '电子邮件',
  //   align: "center",
  //   dataIndex: 'email',
  //   width: 110
  // },
  
  {
    title: '当前岗位',
    align: "center",
    dataIndex: 'post',
    width: 147
  },
  // {
  //   title: '身份',
  //   align: "center",
  //   dataIndex: 'userIdentity_dictText'
  // },
  // {
  //   title: '文化程度',
  //   align: "center",
  //   dataIndex: 'educational_dictText'
  // },
  {
    title: '职称',
    align: "center",
    dataIndex: 'technicalTitle',
    width: 135
  },
  {
    title: '联系方式',
    align: "center",
    dataIndex: 'phone',
    width: 160
  },
  // {
  //   title: '证件类型',
  //   align: "center",
  //   dataIndex: 'cardType_dictText'
  // },
  // {
  //   title: '证件号码',
  //   align: "center",
  //   dataIndex: 'cardNumber'
  // },
  // {
  //   title: '所学专业',
  //   align: "center",
  //   dataIndex: 'specialty'
  // },
  {
    title: '从事本技术领域起始时间',
    align: "center",
    dataIndex: 'startWorkDate',
    width: 230,
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '从事本技术领域年限',
    align: "center",
    dataIndex: 'workYear',
    width: 180
  },
  // {
  //   title: '本人简历(学历和工作经历）',
  //   align: "center",
  //   dataIndex: 'vitae'
  // },
];

//列表数据资质信息
export const columnsA: BasicColumn[] = [
  {
    title: '姓名',
    align: "center",
    dataIndex: 'realname',
    width: 130
  },
 
  {
    title: '性别',
    align: "center",
    dataIndex: 'sex',
    width: 114,
    // sorter: true,
    customRender: ({ text }) => {
      return render.renderDict(text, 'sex');
    },
  },
  {
    title: '员工编号',
    width: 150,
    dataIndex: 'workNo',
  },
  // {
  //   title: '所在部门',
  //   width: 172,
  //   dataIndex: 'orgCode',
  // },
  {
    title: '当前岗位',
    align: "center",
    dataIndex: 'post',
    width: 147
  },
  {
    title: '学历证明',
    align: "center",
    dataIndex: 'edu',
    width: 147
  },
  {
    title: '荣誉证书',
    align: "center",
    dataIndex: 'honor',
    width: 147
  },
];
//列表数据能力信息
export const columnsB: BasicColumn[] = [
  {
    title: '类别名称',
    align: "center",
    dataIndex: 'sortType',
    width: 110
  },
  {
    title: '项目名称',
    align: "left",
    dataIndex: 'itemName',
    width: 130
  },
  {
    title: '依据名称',
    align: "left",
    dataIndex: 'basisName',
  },
  {
    title: '依据编号',
    align: "left",
    dataIndex: 'basisNum',
    width: 125
  },
  {
    title: 'A类',
    align: "center",
    dataIndex: 'itemA',
    width: 95,
    // edit: true,
    // editComponent: 'Checkbox',
    // editValueMap: (value) => {
    //     return value ? '是' : '否';
    // },
  },
  {
    title: 'B类',
    align: "center",
    dataIndex: 'itemB',
    width: 95,
    // edit: true,
    // editComponent: 'Checkbox',
    // editValueMap: (value) => {
    //     return value ? '是' : '否';
    // },
  },
  {
    title: 'C类',
    align: "center",
    dataIndex: 'itemC',
    width: 95,
    // edit: true,
    // editComponent: 'Checkbox',
    // editValueMap: (value) => {
    //     return value ? '是' : '否';
    // },
  },
  {
    title: 'D类',
    align: "center",
    dataIndex: 'itemD',
    width: 95,
    // edit: true,
    // editComponent: 'Checkbox',
    // editValueMap: (value) => {
    //     return value ? '是' : '否';
    // },
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "姓名",
    field: 'realname',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "文化程度",
    field: 'educational',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "education"
    },
    colProps: {span: 6},
  },
  {
    label: "职称",
    field: 'technicalTitle',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '姓名',
    field: 'realname',
    component: 'Input',
  },
  {
    label: '头像',
    field: 'avatar',
    component: 'Input',
  },
  {
    label: '出生日期',
    field: 'birthday',
    component: 'DatePicker',
  },
  {
    label: '性别',
    field: 'sex',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'sex',
      placeholder: '请选择性别',
      stringToNumber: true,
    },
  },
  {
    label: '电子邮件',
    field: 'email',
    component: 'Input',
  },
  {
    label: '电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '职务',
    field: 'post',
    component: 'Input',
  },
  {
    label: '文化程度',
    field: 'educational',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "education"
    },
  },
  {
    label: '职称',
    field: 'technicalTitle',
    component: 'Input',
  },
  {
    label: '证件类型',
    field: 'cardType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "card_type"
    },
  },
  {
    label: '证件号码',
    field: 'cardNumber',
    component: 'Input',
  },
  {
    label: '所学专业',
    field: 'specialty',
    component: 'Input',
  },
  {
    label: '从事本技术领域起始时间',
    field: 'startWorkDate',
    component: 'DatePicker',
  },
  {
    label: '从事本技术领域年限',
    field: 'workYear',
    component: 'InputNumber',
  },
  {
    label: '本人简历(学历和工作经历）',
    field: 'vitae',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

//列表数据资质信息
export const itemColumn: BasicColumn[] = [
  {
    title: '班组',
    align: "center",
    dataIndex: 'team',
    width:95
  },
  {
    title: '类别名称',
    align: "center",
    dataIndex: 'sortType',
    width:135
  },
  {
    title: '项目名称',
    align: "left",
    dataIndex: 'itemName',
    width:155
  },
  {
    title: '标准名称',
    align: "left",
    dataIndex: 'basisName',
  },
  {
    title: '标准编号',
    align: "left",
    dataIndex: 'basisNum',
    width:135
  },
  
];